package com.logos;

import org.junit.Test;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;

public class testProperties {

    @Test
    public void testProperties() throws IOException {
        Properties properties = new Properties();
        // 使用类加载器加载资源文件
        properties.load(getClass().getClassLoader().getResourceAsStream("jdbc.properties"));
        Enumeration<?> enumeration = properties.propertyNames();
        while (enumeration.hasMoreElements()){
            String key = (String) enumeration.nextElement();
            String value = properties.getProperty(key);
            System.out.println(key+"="+value);
        }
    }
}
